﻿using Newtonsoft.Json;
using System.IO;

namespace HamcoWcs.Models.TibcoMessage
{


    public class TibcoConfiguration
    {
        static TibcoConfiguration()
        {
            var configStr = File.ReadAllText("tibco.config.json");
            var config = JsonConvert.DeserializeObject<TibcoConfiguration>(configStr);

            if (string.IsNullOrEmpty(config.SendField)) config.SendField = "xmlData";
            BasicConfiguration = config;
        }

        public static TibcoConfiguration BasicConfiguration { get; private set; }

        public string Daemon { get; set; }
        public string Network { get; set; }
        public string SendField { get; set; } = "xmlData";
        public double SendTimeout { get; set; } = 5;
        public string Service { get; set; }
        public string SendSubject { get; set; }
        public string RecvSubject { get; set; }
        public string LicenseTicket { get; set; }
        public string EventUser { get; set; }


        public bool IsBuildWithVirtualTibcoServer { get; set; } = false;


    }
}